package com.example.comshenhaibing;


import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.TextView;

import java.util.List;

public class dingc extends BaseAdapter {
    private List list;
    private  Context context;

    public dingc(Context context){
        this.context =context;

    }
    @Override
    public int getCount() {
        return 4;
    }
    @Override
    public Object getItem(int position) {
        return list.get(position);
    }
    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView =View.inflate(context,R.layout.dingc,null);
        ImageButton imageButton=convertView.findViewById(R.id.kaoya);
        TextView textView=convertView.findViewById(R.id.kaoy);
        textView.setText("烤鸭");
        imageButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent= new Intent(context,xiangqing.class);
                context.startActivity(intent);
            }
        });
        return convertView;
    }
}
